package com.boat.sample.ddd.interfaces.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.boat.sample.ddd.api.dto.CancelUserTaskReq;
import com.boat.sample.ddd.infrastructure.client.SupportClient;
import com.boat.sample.ddd.interfaces.assembler.UserAssembler;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class CancelUserTask {
	@Autowired
	SupportClient supportClient;
	
	@XxlJob("cancelUserHandler")
    public ReturnT<String> cancelUser() {
		String jobParam = XxlJobHelper.getJobParam();
//        CancelUserTaskReq req = UserAssembler.toCancelUserReq(jobParam);
//        if(true) {
//        	throw new RuntimeException("模拟错误");
//        }
		supportClient.accountInfo(1);
		return ReturnT.SUCCESS;
	}

}
